/**  
* 北京智普信科技股份有限公司
* Copyright Right (c) 2012-2015 Beijing Zeepson technology Co.,Ltd. 
* http://www.candowin.com/
* All right reserved. 
*/ 

package com.chenjun.common.websocket;

import org.springframework.web.socket.TextMessage;  
import org.springframework.web.socket.WebSocketSession;  
import org.springframework.web.socket.handler.TextWebSocketHandler;  
/** 
 * @Title: WebsocketEndPoint 
 * @date 2016年7月11日 上午10:05:57 
 * @version V1.0   
 */

  
public class WebsocketEndPoint extends TextWebSocketHandler {  
  
	private  WebSocketSession session;
	
    @Override  
    protected void handleTextMessage(WebSocketSession session,  
            TextMessage message) throws Exception {  
    	System.out.println("ffffffffffffffffp");
        super.handleTextMessage(session, message);  
        TextMessage returnMessage = new TextMessage(message.getPayload()+" received at server");  
        this.session=session;
        session.sendMessage(returnMessage);  
    }  
    
    public WebSocketSession getSession(){
    	return this.session;
    }
    
}